package org.lee.status.app.event;

import org.lee.status.app.Result;
import org.lee.status.app.State;
import org.lee.status.app.activity.ActivityService;
import org.lee.status.app.activity.Status;

/**
 * DoingState
 * 活动状态：活动中
 *
 * @author dralee
 * @date 2021-11-24 09:43:36
 **/
public class DoingState extends State {
    @Override
    public Result arraignment(String activityId, Status currentStatus) {
        return Result.failure("活动中不可提审");
    }

    @Override
    public Result checkPass(String activityId, Status currentStatus) {
        return Result.failure("活动中不可审核通过");
    }

    @Override
    public Result checkRefuse(String activityId, Status currentStatus) {
        return Result.failure("活动中不可审核拒绝");
    }

    @Override
    public Result checkRevoke(String activityId, Status currentStatus) {
        return Result.failure("活动中不可撤消审核");
    }

    @Override
    public Result close(String activityId, Status currentStatus) {
        ActivityService.execStatus(activityId, currentStatus, Status.CLOSE);
        return Result.success("活动关闭成功");
    }

    @Override
    public Result open(String activityId, Status currentStatus) {
        return Result.failure("活动中不可开启");
    }

    @Override
    public Result doing(String activityId, Status currentStatus) {
        return Result.failure("活动中不可重复执行");
    }
}
